<script>
	export default {
		onLoad:function() {
			
		},
		onLaunch: function() {
			
			console.log('App Launch')
		},
		onShow: function() {
				this.hasLogin()	
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		destroyed() {
			this.$store.state.chat.toneAudio.destroy()
		},
		methods:{
			hasLogin(){
		
				if(!this.$store.state.user.token){
					uni.navigateTo({
					    url: '/pages/login/index'
					});					
				}else{
					this.$store.dispatch('chat/getChatObjectList')//获取所有聊天的对象列表					
				}
			}
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import "@/static/icon/iconfont.css";
	view{
		box-sizing: border-box;
	}
</style>
